feat: enable fetching activity & logging diapers for babies#41
feat: enable fetching activity & logging diapers for babies#41Lash-L merged 1 commit intoLash-L:mainfrom
Conversation
I noticed there was a scratch file in `.gitignore` I wrote this to test out Lash-L#41 and figured it'd be worth sharing within source control!
I noticed there was a scratch file in `.gitignore` I wrote this to test out Lash-L#41 and figured it'd be worth sharing within source control!
Lash-L
left a comment
There was a problem hiding this comment.
Hey! Thanks for the PR! Here's some minor nitpicks.
Sure thing! Addressed all of them I think and retested with an updated script, let me know if you've got any other feedback. |
|
Hey @Lash-L mind taking another look at this? Thanks! |
python_snoo/containers.py
Outdated
| def parse_activities_from_list(activities_data: list) -> list[Activity]: | ||
| """Parse a list of activity dictionaries into typed objects""" | ||
| return [parse_activity_from_dict(activity) for activity in activities_data] |
There was a problem hiding this comment.
My only worry with this is it may make typing complicated. I believe I have strict typing enabled on the HA side. And as this is a list of two different types it may be weird.
I'll leave it up to you if you want to change it or not. You can always see if it gives you a problem on the HA side.
There was a problem hiding this comment.
Looking at this again I didn't really like how I did it the first time anyway. Reworked things a bit and now the only mypy errors are due to authorization logic. Does this address what you were thinking?
I noticed there was a scratch file in `.gitignore` I wrote this to test out Lash-L#41 and figured it'd be worth sharing within source control!
| if r.status < 200 or r.status >= 300: | ||
| raise SnooBabyError(f"Failed to get activity data: {r.status}: {resp}. Payload: {params}") | ||
|
|
||
| activities: list[Activity] = [] |
There was a problem hiding this comment.
other thing I tried out was an AsyncGenerator here but that was getting a little too fancy for this...
|
If you can fix lint I'll merge! |
6e43299 to
1e78dc6
Compare
1e78dc6 to
31b86da
Compare
Think I fixed everything now! |
|
@Lash-L I think you've got to kick the GitHub Actions run one more time... sorry! |
|
Bumper! Ping me when the HA PR is ready for a review! |
I noticed there was a scratch file in `.gitignore` I wrote this to test out Lash-L#41 and figured it'd be worth sharing within source control!
I noticed there was a scratch file in `.gitignore` I wrote this to test out Lash-L#41, and figured it'd be worth sharing within source control!
Changes: https://github.com/Lash-L/python-snoo/releases/tag/v0.7.0 Only `feat: enable fetching activity & logging diapers for babies` Lash-L/python-snoo#41 has changed
I noticed there was a scratch file in `.gitignore` I wrote this to test out Lash-L#41, and figured it'd be worth sharing within source control!
I noticed there was a scratch file in `.gitignore` I wrote this to test out Lash-L#41, and figured it'd be worth sharing within source control!
I noticed there was a scratch file in `.gitignore` I wrote this to test out Lash-L#41, and figured it'd be worth sharing within source control!
Wish I did this 3 weeks ago, but had fun doing it anyway :)
Tested with #42
Draft Home Assistant PR: home-assistant/core#149599